The invention relates to 3D computer graphics, and more particularly, to methods and systems for a 3D computer graphics shading process compiler.
In computer graphics, rendering converts 3D objects in a database into 2D images rendered on video display, mainly comprising establishing polygon models, processing visible and invisible polygons, and shading.
Graphics chips/chipsets typically comprise a compiler for receiving and converting scripts from an application into recognized hardware machine code. Conventional compilers distinguish operations, arguments and modifiers by condition branches, and provide corresponding hardware machine code in condition branches. FIG. 1 is a diagram of pseudo code of a conventional compiler, comprising condition branches 111 and 113 for distinguishing operations, condition branches 121 to 127 for distinguishing arguments, and condition branches 131 to 137 for distinguishing modifiers. These condition branches, however, consume excessive computational power.